//
//  SRSpeakingTestModel.m
//  StoryShow
//
//  Created by CyonLeuMBP on 2017/4/20.
//  Copyright © 2017年 qudiandu.cn. All rights reserved.
//

#import "SRSpeakingTestModel.h"

@implementation SRSpeakingTestModel


//- (NSString *)makeIdentifierWithCourseId:(NSString *)courseId createTime:(NSString *)timeString {
//    NSString *fullString = [NSString stringWithFormat:@"%@%@", courseId, timeString];
//    NSString *identifier = [fullString MD5Hash];
//    return identifier;
//}

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
    return @{
             @"data_id"              : @"data_id",
             @"book_id"                  : @"book_id",
             @"page_id"                : @"page_id",
             @"user_id"                : @"user_id",
             @"totalSentencesCount"     : @"total_sentences_count",
             @"finishedSentencesCount"  : @"finished_sentences_count",
             @"finished"                : @"finished",
             @"createTime"              : @"create_time",
             
             @"mp3name"                 : @"mp3name",

             @"totalScore"              : @"total_score",
             @"accuracyScore"           : @"accuracy_score",
             @"integrityScore"          : @"integrity_score",
             @"fluencyScore"            : @"fluency_score",
             @"sentencesScore"          : @"sentences_score",
             @"wordsScore"              : @"words_score"
             
             };
}

+ (NSValueTransformer *)finishedJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id object) {
        if (!object) {
            return @(0);
        } else {
            return (NSNumber *)object;
        }
    }];
}

+ (NSValueTransformer *)createTimeJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id object) {
        if (!object) {
            return @(0);
        } else {
            return (NSNumber *)object;
        }
    }];
}

+ (NSValueTransformer *)totalScoreJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id object) {
        if (!object) {
            return @(-1000);
        } else {
            return (NSNumber *)object;
        }
    }];
}

+ (NSValueTransformer *)accuracyScoreJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id object) {
        if (!object) {
            return @(-1000);
        } else {
            return (NSNumber *)object;
        }
    }];
}

+ (NSValueTransformer *)integrityScoreJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id object) {
        if (!object) {
            return @(-1000);
        } else {
            return (NSNumber *)object;
        }
    }];
}

+ (NSValueTransformer *)fluencyScoreJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id object) {
        if (!object) {
            return @(-1000);
        } else {
            return (NSNumber *)object;
        }
    }];
}

+ (NSValueTransformer *)sentencesScoreJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id object) {
        if (!object) {
            return @"";
        } else {
            return (NSString *)object;
        }
    }];
}

+ (NSValueTransformer *)wordsScoreJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id object) {
        if (!object) {
            return @"";
        } else {
            return (NSString *)object;
        }
    }];
}




@end
